Ext.define('Admin.view.system.job.Cron', {
	extend: 'Admin.ux.PageGrid',
    xtype: 'cron-view',
    title: '定时器',
    viewModel: {
       stores: { 
	        data: {
	            type: 'cron-store',
	            autoLoad: true
	   		 }
	    },
	    data:{
	    	batchRemoveAction : true,
	    	batchRemoveText:'批量删除(0)',
	    }
    },
    
    controller:'cron',
    listeners: {
        selectionchange: 'onSelectionChange'
    },
	columnLines : false,
 	columns: [
	 	{ xtype: 'rownumberer',width:'5%'},
		{ xtype:'gridcolumnview', width:'10%',text: '定时器名', dataIndex: 'cron_name'},
		{ xtype:'gridcolumnview',width:'10%', text: '定时器表达式', dataIndex: 'cron'},
		{ xtype:'gridcolumnview',width:'35%', text: '详细描述', dataIndex: 'cron_desc'},
	 	{ xtype:'gridcolumnview',width:'12%', text: '创建时间', dataIndex: 'create_time'}, 
	    {
	        menuDisabled: true,
	        sortable: false,
	        xtype: 'actioncolumn',
	        width:'7%',
	        text:'操作',
	        items: [
				{
				    iconCls: 'array-grid-buy-col',
				    tooltip: '编辑',
				    handler:'editAction'
				},
				'-',
				{
				    iconCls: 'array-grid-sell-col',
				    tooltip: '删除',
				    handler: 'removeAction'
				}
				]
	    }
	],
	
    tbar:[
		{
			text:'新建定时器',
			iconCls: 'x-fa fa-plus',
			handler:'addAction'
		},
    	{
			text:'表达式生成器',
			iconCls: 'x-fa fa-download',
			handler:'downLoadAction'
		},
		{
    		iconCls: 'x-fa fa-minus',
	    	handler:'batchRemoveAction',
	    	bind:{
    			disabled :'{batchRemoveAction}',
    			text:'{batchRemoveText}'
    		}
    	},
		'->',
		{
			xtype : 'keysearchfield'
		}
	]
});
